import request from '@/utils/request'
import { IResp } from './interfaces'
import { DBKeys } from './commonCrud'

export type DBKeysUnauth = Omit<DBKeys, 'users' | 'bigModelConfigs'>


// 获取分页列表
export const getListUnauth = (
    db: DBKeys,
    searchParams: any,
    dbInclude: any[] = []
) => {
    return request.post<any, IResp>(`/unauth-crud/getList/${db}`, {
        page: 1,
        pageSize: 10,
        ...searchParams,
        dbInclude,
    })
}

// 删除
// export const del = (db: DBKeys, id: number) => {
//     return request.delete<any, IResp>(`/unauth-crud/${db}/${id}`)
// }

// 更新
// export const update = (db: DBKeys, id: number, data: any) => {
//     return request.put<any, IResp>(`/unauth-crud/${db}/${id}`, data)
// }

// 添加
// export const add = (db: DBKeys, data: any) => {
//     return request.post<any, IResp>(`/unauth-crud/${db}`, data)
// }
